﻿using System.Collections.Generic;
using DataAccess.Services.Interfaces;
using DataControl;
using NHibernate;
using DataAccess.Services.Constants;

namespace DataAccess.Services.Gateways
{
	internal class DocumentEnvelopeGateway : GatewayBase<Document_Envelope>, IDocumentEnvelopeGateway
	{
		public DocumentEnvelopeGateway(ISession session)
			: base(session)
		{
		}

		public IEnumerable<Document_Envelope> SelectSentEnvelopes()
		{
			return DataControl.GetFiltredItems<Document_Envelope>("statusfk", DocumentEnvelopeStatusEnum.Instance.Received ) ;
		}

		public IEnumerable<Document_Envelope> SelectEnvelopesBySender(int senderId)
		{
			return DataControl.GetFiltredItems<Document_Envelope>("SenderFK", senderId);
		}

		public IList<Document_Envelope> GetAll()
		{
			return dataControl.GetAllItems<Document_Envelope>();
		}
	}
}
